<%-- 
    Document   : waitPage
    Created on : 13/07/2011, 00:01:26
    Author     : Assaf
--%>

<%@page contentType="text/html" pageEncoding="UTF-8"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
   "http://www.w3.org/TR/html4/loose.dtd">

<html><head>

<script>
<!--
var mins = 1; // Set Minutes
var secs = 1; // Set seconds
function timer()
{
    // tic tac
    if( --secs == -1 )
    {
	secs = 59;
	--mins;
    }

    // leading zero? MonWaittting
    if( secs < 10 ) secs = "0" + secs;
    if( mins < 10 ) mins = "0" + parseInt( mins, 10 );

    // display
    document.MonWait.mins.value = mins;
    document.MonWait.secs.value = secs;

    // continue?
    if( secs == 0 && mins == 0 ) // time over
    {
	document.MonWait.ok.disabled = true;
	document.again.results.style.display = "block";
    }
    else // call timer() recursively every 1000 ms == 1 sec
    {
	window.setTimeout( "timer()", 1000 );
    }
}
//-->
</script>
	<title>Java Web Monopoly Game</title>
<link rel="stylesheet" href="css/loadPage.css">
</head>
<%
	// Get and Parse the Parameters
	String gameName = (String)request.getAttribute("gameName");
	String errMsg = (String)request.getAttribute("err_msg");
	Integer nPlayers, nhPlayers,joinedHuman;
	Boolean bAutoDice;
	try {
		nPlayers = (Integer)request.getAttribute("nPlayers");
		nhPlayers = (Integer)request.getAttribute("nhPlayers");
		joinedHuman = (Integer)request.getAttribute("joinedPlayers");
	} catch (NumberFormatException e) {
		nPlayers = 0;
		nhPlayers = 0;
		joinedHuman = 0;
	}
	bAutoDice  = (Boolean)request.getAttribute("autoDice");
%>



<body>
	<h1>Welcome to the Java Monopoly Game!</h1>
	<h2>A Monopoly Game by Avia Tam and Assaf Miron</h2>
	<BR>
	<H1>
	    Waiting for other Players...
	</H1>
	<BR>

	<div><H2><B><U>Game Details</U></B></H2>
	<B>Game Name:</B><%=gameName%><BR>
	<B>Num. Of Players:</B><%=nPlayers%>&nbsp;&nbsp;
	<B>Num. of Human Players:</B><%=nhPlayers%><BR>
	<%if(bAutoDice){ %><B>Using Automatic Dice Mode</B>
	<%}else{ %><B>Using Manual Dice Mode</B> <%} %><BR>
	<B>Num Of Joined Human Players:</B><%=joinedHuman%><BR>
	</div>
<form action="#" name="again">
<input type="submit" name="results" value="Check Again" style="display:none;">
</form>
<script>
<!--
timer(); // call timer() after page is loaded
//-->
</script>
</body></html>